package com.myway.dto.currencyrate;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Currency;
import java.util.Date;


/**  
* @ClassName: DTOExRate  
* @Description: 币制转换率
* @author Jiang.Yida
* @date 2015年10月23日 下午1:31:35  
*    
*/
public class DTOExRate implements Serializable {

	private long id;
	private Currency fromCurr;
	private Currency toCurr;
	private BigDecimal rate;
	private Date suiteDate;
	private String airlineCode;
	private Date createDate;
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public Currency getFromCurr() {
		return fromCurr;
	}
	public void setFromCurr(Currency fromCurr) {
		this.fromCurr = fromCurr;
	}

	public Currency getToCurr() {
		return toCurr;
	}
	public void setToCurr(Currency toCurr) {
		this.toCurr = toCurr;
	}

	public BigDecimal getRate() {
		return rate;
	}
	public void setRate(BigDecimal rate) {
		this.rate = rate;
	}
	public Date getSuiteDate() {
		return suiteDate;
	}
	public void setSuiteDate(Date suiteDate) {
		this.suiteDate = suiteDate;
	}
	public String getAirlineCode() {
		return airlineCode;
	}
	public void setAirlineCode(String airlineCode) {
		this.airlineCode = airlineCode;
	}
	
	public BigDecimal getAmount(BigDecimal amount){
		return amount.multiply(rate);
	}
	
	public BigDecimal getAmount(BigDecimal amount, int scale, int round){
		return amount.multiply(rate).setScale(scale, round);
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	@Override
	public String toString() {
		return "DTOExRate [id=" + id + ", fromCurr=" + fromCurr + ", toCurr=" + toCurr + ", rate=" + rate + ", suiteDate=" + suiteDate + ", airlineCode=" + airlineCode + ", createDate=" + createDate
				+ "]";
	}
	
	
}
